<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Resource extends MY_Controller {
	//构造函数
	public function __construct()
	{
		parent::__construct();
		$this->new_catgory = $this->home->get_category_by_id(37);
	}
	public function index(){
		$this->article();
	}

	public function article()
	{
		$data = array();
		$data['cates'] = $this->new_catgory;
		$current_cat = current($data['cates']['data']);
		$cid = $this->uri->segment(3);
		$data['recentid'] = $cid ==false ? $current_cat['cid']: $cid;
		$data['catname'] = 'resourse';
		$data['cur_catname'] = $data['cates']['data'][$data['recentid']]['catname'];

		$data['ainfo'] = $this->home->get_ainfo_by_cid($data['recentid']);
		template('about/about_info',$data);
	}

    public function collegebuildings()
    {
    	$data = array();
    	$data['cates'] = $this->new_catgory;
    	$data['recentid'] = '38';
    	$data['catname'] = 'resourse';
    	$data['cur_catname'] = 'college buildings';
    	template('resourse/buildings',$data);
    }

    public function laboratory()
    {
    	$data = array();
    	$data['cates'] = $this->new_catgory;
    	$data['recentid'] = '40';
    	$data['catname'] = 'resourse';
    	$data['cur_catname'] = 'laboratory';
    	template('resourse/laboratory',$data);
    }
}